<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
	<head>
		<%@ include file="/common/taglibs.jsp"%>
		<title>sinlog</title>
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north',border:false" style="height:60px;padding-left: 20px;background-color:#77DDFF;color:#FFFFFF">
			<h2 style="margin-bottom: 0px;">SINLOG</h2>
			<div style="text-align: right; padding-right: 50px;">
				<span>当前用户：</span><span>${principle.userName}</span>&nbsp;&nbsp;|&nbsp;
				<span>北京时间：</span><span id="bjTime"></span>&nbsp;&nbsp;|&nbsp;
				<a class="logoutBtn" href="javascript:logout()">退出</a>
			</div>
		</div>
		<div data-options="region:'west',split:true" style="width:150px;">
			<%@include file="common/menu.jsp" %>
		</div>
		<div data-options="region:'south',border:false" style="height:50px;padding:10px;text-align: right;padding-right:50px;">
			Design by szf
		</div>
		<div id="center" data-options="region:'center'">
			<div id="p"></div>
		</div>
<script type="text/javascript">
	$(document).ready(function(){
		showTime();
		$('#p').panel({  
			fit: true,
			loadingMessage: '页面加载中...',
			title:' '
		});  
		$('#menuDiv .menItem a').click(function(event){
			var $this = $(this);
			var title = $this.html();
			var url = $this.attr('href');
			openMenu(title,url);
			$('#menuDiv a.selMenu').removeClass('selMenu');
			$(this).addClass('selMenu');
			event.preventDefault();
		});
		
		$('#menuDiv .menItem a:first').trigger('click');
		
		$('.searDiv input').live('keypress',function(event){
			if(event.keyCode == 13){
				if(doQuery){
					doQuery();
				}
			}
		});
	});
	
	function openMenu(title,url){
		$('#p').panel('refresh',url);  
		$('#p').panel('setTitle',title);  
	}
	function getCH(){
		var centerH = $('#center').height();
		return centerH;
	}
	
	function getDgH(sub){
		var centerH = parent.getCH();
		var children = $('.mainContent').children();
		var childrenLen = children.length;
		var subH = 0;
		for(var i=0;i<childrenLen;i++){
			if(!$(children[i]).hasClass(sub)){
				subH += $(children[i]).height();
			}
		}
		return centerH - subH;
	}
	
	function showTime(){
		setInterval(function(){
			var time = new Date().format('yyyy-MM-dd hh:mm:ss');
			document.getElementById("bjTime").innerHTML = time;
		},1000);
	}
	
	function logout(){
		$("body").mask("退出中..");
		window.location.href = '${ctx}/logout.action';
	}
	
	function wait(){
		$("#center").mask("请稍等..");
	}
	function uwait(){
		$("#center").unmask();
	}

</script>
	</body>
</html>